<template>
    <ProForm :columns="formColumns" :span="8" @ok="submit"/>
</template>
<script setup lang="ts">
import 'element-plus/dist/index.css'
import { createProForm, ProForm } from '@howuse/element-plus-form'

const { formColumns } = createProForm([
    {
        label: "姓名",
        key: "name",
        value: "",
        is: "ElInput",
    },
    {
        label: "年龄",
        key: "age",
        value: "",
        is: "ElInput",
    },
    {
        label: "体重",
        key: "weight",
        value: "",
        is: "ElInput",
    },
    {
        label: "城市",
        key: "city",
        value: "",
        is: "ElSelect",
        data: [{ label: "北京", value: 1 }, { label: "上海", value: 2 }],
        optionLabel: "label",
        optionValue: "value",
    },
])

function submit(raw) {
    alert(JSON.stringify(raw))
}
</script>